CSharpTest.Net
Add(Byte[],Int32,Int32) Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.IO Namespace > Crc64 Structure > Add Method : Add(Byte[],Int32,Int32) Method

bytes
start
length

Glossary Item Box

Adds a range from an array of bytes to the checksum

Syntax

Visual Basic (Declaration) 
Public Overloads Sub Add( _
   ByVal bytes() As Byte, _
   ByVal start As Integer, _
   ByVal length As Integer _
) 
C# 
public void Add( 
   byte[] bytes,
   int start,
   int length
)

Parameters

bytes
start
length

Example

Library/Library.Test/TestCrc64.cs

C#Copy Code
Crc64 all = new Crc64(new byte[] { 0x2, 0x3, 0x4, 0x5, 0x6 });
Crc64 crc = new Crc64();
Assert.AreEqual(0, crc.Value);
crc.Add(new byte[] { 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8 }, 1, 5);
Assert.AreEqual(all.Value, crc.Value);
VB.NETCopy Code
Dim all As New Crc64(New Byte() {&H2, &H3, &H4, &H5, &H6})
Dim crc As New Crc64()
Assert.AreEqual(0, crc.Value)
crc.Add(New Byte() {&H1, &H2, &H3, &H4, &H5, &H6, _
    &H7, &H8}, 1, 5)
Assert.AreEqual(all.Value, crc.Value)

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys